<?php
class Default_BottomMenu {
   public function BottomMenu(){
   	$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
   	$menu = array('tin-tuc'=>'','quy-dinh-bao-hanh'=>'','he-thong-cua-hang'=>'','video'=>'','lien-he'=>'');
   	$controller = Zend_Controller_Front::getInstance()->getRequest()->getControllerName();
	$action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();
	if($controller == 'index')
		if($action == 'contact')
			$menu['lien-he'] = ' active ';
	if($controller == 'articlecat')
	{
		$alias = Zend_Controller_Front::getInstance()->getRequest()->getParam('alias','');
		if($alias!='')
	    {
	    	if($alias == 'tin-tuc' || $alias == 'tu-van')
	    	{
	    		$menu['tin-tuc'] = ' active ';
	    	}		
	    }
	}
	if($controller == 'article')
	{
		$alias = Zend_Controller_Front::getInstance()->getRequest()->getParam('alias','');
		if($alias!='')
	    {
	    	if($alias == 'he-thong-cua-hang')
	    	{
	    		$menu['he-thong-cua-hang'] = ' active ';
	    	}
		    if($alias == 'quy-dinh-bao-hanh')
		    {
		    		$menu['quy-dinh-bao-hanh'] = ' active ';
		    }
	     	if($alias == 'video')
		    {
		    		$menu['video'] = ' active ';
		    }
		    $model_article = new Model_Article_Article();
		    $item_article = $model_article->getItemAlias($alias);
		    $model_catergory = new Model_ArticleCat_ArticleCat();
		    $item_cat = $model_catergory->getItemId($item_article['category']);
		    if($item_cat['alias']== 'tin-tuc' || $item_cat['alias'] == 'tu-van')
		    {
		    	$menu['tin-tuc'] = ' active ';
		    }
	    }
	}
   	require_once 'views/default.php';
   }
}